package edu.gdit.health.service.impl;

import edu.gdit.health.base.Results;
import edu.gdit.health.dao.LoggingEventDao;
import edu.gdit.health.model.LoggingEvent;
import edu.gdit.health.service.LoggingEventService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class LoggingEventServiceImpl implements LoggingEventService {
    @Autowired
    private LoggingEventDao loggingEventDao;
    @Override
    public Results<LoggingEvent> getAll(int page,int limit) {
        int offset=(page-1)*limit;
        int count=loggingEventDao.count();
        return Results.success(count,loggingEventDao.getAll(offset,limit));
    }
}
